package com.huluobo.koltinim2003a.ui.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.huluobo.koltinim2003a.R
import com.huluobo.koltinim2003a.base.BaseActivity
import com.huluobo.koltinim2003a.extention.FragmentFactory
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : BaseActivity() {
    override fun getLayoutResId(): Int = R.layout.activity_main

    override fun init() {
        super.init()
        bottomBar.setOnTabSelectListener { tabId ->
            val beginTransient = supportFragmentManager.beginTransaction()
            beginTransient.replace(
                R.id.fragment_frame,
                FragmentFactory.instance.setFragment(tabId)!!//双叹号代表当前返回值绝对不为空
            )
            beginTransient.commit()
        }
    }
}